package com.wenwen.social.common.config;


import com.wenwen.social.common.filter.OriginFilter;
import com.wenwen.social.common.filter.XssFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

//@Configuration
public class FilterConfig {
	//@Bean
	public FilterRegistrationBean filterCrosBean(){
		FilterRegistrationBean bean = new FilterRegistrationBean();
		bean.setFilter(new OriginFilter());
		bean.addUrlPatterns("/*");
		return bean;
	}
	//@Bean
	public FilterRegistrationBean filterRegistrationBean(){
		FilterRegistrationBean bean = new FilterRegistrationBean();
		bean.setFilter(new XssFilter());
		bean.addUrlPatterns("/*");
		return bean;
	}
}
